package com.sportswork.sportswork.core.service.impl;

import com.sportswork.sportswork.core.entity.Credit;
import com.sportswork.sportswork.core.entity.Teacher;
import com.sportswork.sportswork.core.mapper.CreditMapper;
import com.sportswork.sportswork.core.mapper.TeacherMapper;
import com.sportswork.sportswork.core.service.ICreditService;
import com.sportswork.sportswork.core.service.ITeacherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author dengwei
 * @date 2020/2/3 12:02
 * @description
 */
@Slf4j
@Service
@Transactional
public class CreditServiceImp implements ICreditService {
    @Resource
    private CreditMapper creditMapper;


    @Override
    public Credit addCredit(Credit credit) {
        creditMapper.addCredit(credit);
        return credit;
    }

    @Override
    public Credit getCredit(String id) {
        return creditMapper.getCredit(id);
    }

    @Override
    public Credit getCreditByXsid(String xsid) {
        return creditMapper.getCreditByXsid(xsid);
    }

    @Override
    public Credit getCreditByNumber(String number) {
        return  creditMapper.getCreditByNumber(number);
    }

    @Override
    public List<Credit> getAllCredit(String number, String name,String xsid) {
        return creditMapper.getAllCredits(number,name,xsid);
    }

    @Override
    public void deleteCredit(String id) {
        creditMapper.deleteCredit(id);
    }

    @Override
    public void deleteCredits(String ids) {
        creditMapper.deleteCredits(ids);
    }

    @Override
    public Credit setCredit(Credit credit) {
        creditMapper.setCredit(credit);
        return credit;
    }

    @Override
    public void setCreditByXsid(Credit credit) {
        creditMapper.setCreditByXsid(credit);
    }
}
